#define  _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
void poor(int* left, int* ringht)
{
    while (left < ringht)
    {
        int temp = *left;
        *left = *ringht;
        *ringht = temp;
        left++;
        ringht--;
    }
}
void rotate(int* nums, int numsSize, int k) {
    k = k % numsSize;
    poor(nums + (numsSize - k), nums + (numsSize - 1));
    poor(nums, nums + (numsSize - k - 1));
    poor(nums, nums + numsSize - 1);

}